<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>

        // 对象的方法可以使用简写
        // 原来的  say : function(){}
        // 简写的  say(){}


        // const obj = {
        //     name : 'yy' , 
        //     say : function(){}
        // }

        const obj = {
            name : 'cc' ,
            say() {
                console.log('say');
            }
        }


        obj.say()


        function outer() {
            var a = 1 ;
            return {
                get() {
                    return a
                } , 
                set(v) {
                    a = v
                }
            }
        }

        const box = outer() ;
        box.set(4) ;

        console.log(box.get());



    </script>
    
</body>
</html>